static public var overColor = new Color(1.0,0.5,0.0);
static public var mainColor = new Color(1.0,1.0,0.0);
public var slider:Transform;
public var isDrag: boolean = false;
private var scrollSpeed: float = 0.1;
private var downCound: int = 1;
private var downMaxCount: int = 10;

function Start() {
}

function OnMouseEnter() {
	renderer.material.color = overColor;
}

function OnMouseExit() {
	renderer.material.color = mainColor;
}

function OnMouseUp() {
	if(downCound==downMaxCount){
		CoreApplication.setNewLevel(4);
		Application.LoadLevel(1);
	}else{
		if(!isDrag){
			isDrag = true;
			downCound++;
		}
	}
}

function Update () {
	if(isDrag){
//		var offset = Time.time * scrollSpeed;
		slider.renderer.material.mainTextureOffset.x += scrollSpeed;
		isDrag = false;
	}
}